home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, ExtCtrls;
-
- type
- TForm1 = class(TForm)
- Panel1: TPanel;
- LabelInitDir: TLabel;
- EditInitDirectory: TEdit;
- ButtonListFiles: TButton;
- ListBox1: TListBox;
- ButtonDeleteDirs: TButton;
- procedure ButtonListFilesClick(Sender: TObject);
- procedure ButtonDeleteDirsClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- uses FileList, DelDirs;
-
- procedure TForm1.ButtonListFilesClick(Sender: TObject);
- var
- FileList: TFileList;
- begin
- FileList:= TFileList.Create (EditInitDirectory.Text,True);
- try
- ListBox1.Items.Clear;
- ListBox1.Items.Assign(FileList.Files_Found);
- finally
- FileList.Free;
- end;
- end;
-
- procedure TForm1.ButtonDeleteDirsClick(Sender: TObject);
- begin
- if MessageDlg( 'Are you sure you want to delete the directory ' +
- '''' + EditInitDirectory.Text + '''' +
- ' and its sub-directories ?',
- mtConfirmation,[mbYes,mbNo],0) = mrYes then
- Delete_Tree ( EditInitDirectory.Text );
- end;
-
- end.
-